-
-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add repr() calls to "invalid value" exception message in StrConverter.to_bool #2666
Conversation
for more information, see https://pre-commit.ci
Also needs a test. My guess is you're passing an empty string for boolean. |
Thanks for the quick review, by the way! That was our thought as well (passing in an empty string), but the logic in the code should be able to handle an empty string, as that appears to be one of the values in VALID_BOOL. I looked for other tests, but did not see any for this method. |
https://github.com/tox-dev/tox/blob/main/tests/config/test_sets.py#L92 |
Ah, I was looking for something specifically testing to_bool(). Found the appropriate test, updated the expected error message. |
for more information, see https://pre-commit.ci
Reverted repr() on VALID_BOOL list items, and updated existing test to reflect changed message. |
After upgrading to 4.0, we are getting the following exceptions in our build pipeline:
We cannot reproduce the issue locally, else we would have more debugging tools and options.
This PR adds !r to display the repr() of the bad value, as well as repr()'s the values in VALID_BOOL, to help diagnose issues when running locally is not an option.
Thanks for contribution
Please, make sure you address all the checklists (for details on how see
development documentation)!
tox -e fix_lint
)docs/changelog
folder